<%@page isELIgnored="false" contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:url value="/css/style.css" var="cssUrl"></c:url>
<c:url value="/backend/CategoryAdmin" var="backendUrl"></c:url>
<c:url value="/CategoryList" var="catalogUrl"></c:url>
<c:url value="/RegisterUser" var="registerUrl"></c:url>
<c:url value="/customer/MyAccount" var="myAccountUrl"></c:url>
<c:url value="/Inloggen" var="loginUrl"></c:url>
<c:url value="/Logout" var="logoutUrl"></c:url>
<jsp:useBean id="sessionData" scope="session" class="utils.SessionData" type="utils.SessionData" />

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>${headTitle.length() > 0 ? headTitle : "head title"}</title>
        <link rel="stylesheet" href="${cssUrl}" type="text/css"/>
    </head>
    <body>
        <div id="pageContainer">
            <div id="header">
                <h1>Computer Webshop</h1>
            </div>
            <div id="menu">
                <c:if test="${sessionData.user.userRole == 'BACKEND_USER'}">
                    <a href="${backendUrl}">Backend</a> |
                </c:if>
                <a href="${catalogUrl}">Catalogus</a> | 
                <c:if test="${sessionData.user == null}">
                    <a href="${registerUrl}">Registreren</a> | 
                    <a href="${loginUrl}">Inloggen</a> |
                </c:if>
                <c:if test="${sessionData.user != null}">
                    <a href="${logoutUrl}">Uitloggen</a> |
                </c:if>
                <c:if test="${sessionData.user.userRole == 'CUSTOMER'}">
                    <a href="${myAccountUrl}">Mijn account</a>
                </c:if>
            </div>  
            <div id="content">